package com.dys.testsuper;

/**
 * @className: com.dys.testsuper.Student
 * @description: com.dys.testsuper
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/07/18 下午10:24
 */
public class Student extends BasePerson {
    double score;
    int age = 20;

    public void eat() {
        System.out.println("子类eat");
    }

    public void study() {
        System.out.println("学习的方法....");
    }

    public void test() {
        // 当子类属性与父类属性同名时,必须使用super.,子类方法与父类方法同名时，使用super.
        System.out.println(this.age);
        System.out.println(super.age);
        this.eat();
        super.eat();
    }
}
